<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    /* 

    */
    let arr = [1, 2, 3, 5, 2, 6, 4, 6, 7, 2, 4, 1];
    for (var i = 0; i < arr.length; i++) {
      let index = arr.indexOf(arr[i], i + 1);
      if (index != "-1") {
        arr.splice(index, 1);
        i--;
      }
    }
    console.log(arr);
    let re = [];
    let arr1 = [1, 2, 3, 5, 2, 6, 4, 6, 7, 2, 4, 1];
    for (let ele of arr1) {
      if (re.indexOf(ele) == "-1") {
        re.push(ele);
      }
    }
    console.log(re, "re");
    let ar3 = [1, 2, 67, 7, 45, 75, 42, 6, 642, 75, 532, 673, 523];
    for (var i = 0; i < ar3.length; i++) {
      for (var j = 0; j < ar3.length - 1; j++) {
        let num = ar3[i];
        if (num < ar3[j]) {
          ar3[i] = ar3[j];
          ar3[j] = num;
        }
      }
    }
    let sort1 = [1, 3, 623, 6734, 6723, 613, 6, 2, 43, 53, 1, 6, 13, 63];
    //快速排序
    function MySort(arr) {
      if (arr.length <= 1) return arr;
      let mid = Math.floor(arr.length / 2);
      let midNum = arr.splice(mid, 1)[0];
      let left = [];
      let right = [];
      for (let num of arr) {
        if (num < midNum) {
          left.push(num);
        } else {
          right.push(num);
        }
      }

      return [...MySort(left), midNum, ...MySort(right)];
    }
    console.log(MySort(sort1));
    let result = [];
    let left = [];
    let right = [];
    let content =
      "5045_A;5046_B;5043_B;5044_B;5047_C;5048_BC;5051_ABC;5049_AB;5052_ABC;5050_ABC;ST#[5055_=_测试使用]#[5057_=_123321嘿嘿]#[5056_=_123321嘿嘿]#[5053_=_123321嘿嘿]#[5054_=_123321嘿嘿]ED";
    left = content.split("ST#")[0].split(";");
    left.pop();
    left.forEach((item) => {
      let res = item.split("_")[1];
      result.push(res);
    });
    right = content.split("ST#")[1].split("ED")[0].split("#");
    right.forEach((item) => {
      let res = item.split("=")[1].replace("_", "").replace("]", "");
      result.push(res);
    });
    console.log(result);
  </script>
</html>
